package com.ym.medical.domain.param;

import com.ym.common.constant.BeanCovert;
import static com.ym.common.constant.ValidRule.Add;
import static com.ym.common.constant.ValidRule.Update;
import com.ym.medical.domain.entity.CouponEntity;
import com.ym.common.annotations.CustomConstraint;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;

/**
 * 优惠劵对象 coupon
 *
 * @author ym
 * @date 2020-09-15
 */
@ApiModel("优惠劵-修改")
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CouponUpdateParam extends BeanCovert<CouponEntity>{

    @ApiModelProperty("主键")
    @NotNull(message = "主键不能为空", groups = {Add.class, Update.class})
    private Long id;

    @ApiModelProperty("优惠劵名称")
    @Size(max = 30, message = "优惠劵名称长度超过{max}", groups = {Add.class, Update.class})
    private String couponName;

    @ApiModelProperty("01满减券02折扣券03兑换券")
    @NotEmpty(message = "01满减券02折扣券03兑换券不能为空", groups = {Add.class, Update.class})
    @Size(max = 2, message = "01满减券02折扣券03兑换券长度超过{max}", groups = {Add.class, Update.class})
    private String theType;

    @ApiModelProperty("折扣比例")
    private Double discount;

    @ApiModelProperty("0表示无门槛")
    private Double fullLimit;

    @ApiModelProperty("满额减扣金额")
    private Double fullMoney;

    @ApiModelProperty("折扣上限金额，0表示无上限")
    private Double discountMoney;

    @ApiModelProperty("01图文问诊02电话问诊03视频问诊")
    @NotEmpty(message = "01图文问诊02电话问诊03视频问诊不能为空", groups = {Add.class, Update.class})
    @Size(max = 2, message = "01图文问诊02电话问诊03视频问诊长度超过{max}", groups = {Add.class, Update.class})
    private String toSb;

    @ApiModelProperty("01固定时间02领取x天失效")
    @NotEmpty(message = "01固定时间02领取x天失效不能为空", groups = {Add.class, Update.class})
    @Size(max = 2, message = "01固定时间02领取x天失效长度超过{max}", groups = {Add.class, Update.class})
    private String validModel;

    @ApiModelProperty("有效开始时间")
    @NotNull(message = "有效开始时间不能为空", groups = {Add.class, Update.class})
    private Date startTime;

    @ApiModelProperty("有效结束时间")
    private Date endTime;

    @ApiModelProperty("有效天数，0表示无限")
    private Integer validDay;

    @ApiModelProperty("发放数量限制,0表示无限制")
    private Integer numLimit;

    @ApiModelProperty("发放递减字段")
    @NotNull(message = "发放递减字段不能为空", groups = {Add.class, Update.class})
    private Integer decNumLimit;

    @ApiModelProperty("系统优惠劵00否01是")
    @NotEmpty(message = "系统优惠劵00否01是不能为空", groups = {Add.class, Update.class})
    @Size(max = 2, message = "系统优惠劵00否01是长度超过{max}", groups = {Add.class, Update.class})
    private String isSys;

    @ApiModelProperty("发布状态(01-待发布；02-已发布)")
    @Size(max = 2, message = "发布状态长度超过{max}", groups = {Add.class, Update.class})
    private String pubState;

    @ApiModelProperty("购买方式(金币)")
    private Double buyGold;

    @ApiModelProperty("创建人")
    @NotNull(message = "创建人不能为空", groups = {Add.class, Update.class})
    private Long createPerson;

    @ApiModelProperty("创建时间")
    @NotNull(message = "创建时间不能为空", groups = Add.class)
    private Date createTime;

    @ApiModelProperty("购买方式(现金)")
    private Double buyCash;

}
